-- GENERATED SPELL FOR [Winterfall Totemic] --


function spell0_7441(pUnit, Event) --@Earthbind Totem,Self--
if charge_disp ~= 'na' then
pUnit:FullCastSpellOnTarget(15786,pUnit)
local charge_disp = 'na'
end
pUnit:RegisterEvent('Sorts_7441', 1, 1)
end

function spell1_7441(pUnit, Event) --@Moonflare Totem,Self--
if charge_disp ~= 'na' then
pUnit:FullCastSpellOnTarget(15787,pUnit)
local charge_disp = 'na'
end
pUnit:RegisterEvent('Sorts_7441', 1, 1)
end

function spell2_7441(pUnit, Event) --@Winterfall Firewater,Self--
pUnit:FullCastSpellOnTarget(17205,pUnit)
pUnit:RegisterEvent('Sorts_7441', 0, 1)
end

function Sorts_7441(pUnit, Event)
local choix_sorts_7441 = math.random(0, 2)
if choix_sorts_7441 == 0 then
pUnit:RegisterEvent('spell0_7441', 1, 1)
end
if choix_sorts_7441 == 1 then
pUnit:RegisterEvent('spell1_7441', 1, 1)
end
if choix_sorts_7441 == 2 then
pUnit:RegisterEvent('spell2_7441', 1, 1)
end
end

function mob7441_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_7441', math.random(1500, 3000), 1)
end

function mob7441_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob7441_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob7441_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(7441, 1, 'mob7441_Action')
RegisterUnitEvent(7441, 2, 'mob7441_Leave')
RegisterUnitEvent(7441, 3, 'mob7441_Kill')
RegisterUnitEvent(7441, 4, 'mob7441_Die')
